program TermProject(input,output); {Chris ########## Prof: Anderson CIS 201 Term Project} uses crt,graph,dos; const Gray50 : FillPatternType = ($BB, $33, $BB, $33, $BB, $33, $BB, $33); var Gdriva, Gwhat,i,l,Num:integer; K:char; SFile:text; FDat,Name,Card,CCNum,which,order:string; procedure Main;forward; procedure HardWare;forward; procedure ShowInventory(wat:string);forward; procedure ReadFile(LookFor:string;x,y:integer); forward; procedure SoftWare; forward; procedure TechHelp; forward; procedure ClearFrame; forward; procedure ShowOrder(Section:string;Num:integer);forward; procedure ShowInventory(wat:string); begin; ClearFrame; SetTextStyle(defaultfont, HorizDir, 2); outtextxy(190,5,wat); SetTextStyle(defaultfont, HorizDir, 1); ReadFile(wat,180,50); outtextxy(170,GetMaxY-10,'Please press order # or Q to quit.'); repeat K:=ReadKey until (K>'0') and (K<'5') or (K>='A') and (K<'J'); ClearFrame; case K of '1':SoftWare; '2':HardWare; '3':TechHelp; '4':exit; 'A':ShowOrder(wat,0); 'B':ShowOrder(wat,1); 'C':ShowOrder(wat,2); 'D':ShowOrder(wat,3); 'E':ShowOrder(wat,4); 'F':ShowOrder(wat,5); 'G':ShowOrder(wat,6); 'H':ShowOrder(wat,7); 'I':ShowOrder(wat,8); End; readln; end; {show inventory} procedure ClearFrame; begin; setcolor(0); setfillstyle(0,0); bar(151,0,GetmaxX,GetmaxY); setcolor(15); end; procedure ReadFile(LookFor:string;x,y:integer); begin; l:=0; setcolor(15); assign(sFile,'a:setec.stc'); reset(sFile); repeat readln(sFile,FDat); l:=l+1; until FDat=LookFor; for i:=l+1 to l+9 do begin; readln(sfile,FDat); outtextxy(x,y,FDat); y:=y+20 end; close(sFile); end;{ReadFile} procedure ShowOrder(Section:string;Num:integer); begin; l:=0; setcolor(15); assign(sFile,'a:setec.stc'); reset(sFile); repeat readln(sFile,FDat); l:=l+1; until FDat=Section; for i:=l+1 to l+1+Num do begin; readln(sfile,FDat); end; outtextxy(170,60,FDat); close(sFile); SetTextStyle(defaultfont, HorizDir, 2); outtextxy(190,5,'Order'); SetTextStyle(defaultfont, HorizDir, 1); outtextxy(170,30,'you have selected to order'); outtextxy(170,90,'is this correct? Y/N'); repeat K:=ReadKey until (K='Y') or (K='N'); if K='N' then main else begin; outtextxy(150,120,'Name:'); gotoxy(150,140); readln(name); outtextxy(170,140,'Credit Card Company:'); gotoxy(170,140); readln(Card); outtextxy(190,160,'Credit Card Number:'); gotoxy(190,140); readln(CCNum); outtextxy(GetMaxX div 2,200,'Processing Order...'); delay(2000); outtextxy(GetMaxX div 2,220,'Order complete'); delay(1000); outtextxy(GetMaxX div 2,240,'Please wait 5 to 10 days for delivery.'); outtextxy(GetMaxX div 2,260,'Address will be gathered from Card info.'); delay(2500); ClearFrame; Main; end;{end if} end;{ShowOrder} procedure Main; var Par:string; begin; GDriva:=Detect; initgraph(Gdriva,Gwhat,' '); if GraphResult <>grOK then Halt(1); SetFillPattern(Gray50, blue); textbackground(red); rectangle(0,0,150,450); delay(50); Bar3D(30,30, 80, 80, 15, TopOn); delay(50); setcolor(blue); SetTextStyle(defaultfont, HorizDir, 3); OutTextXY(48, 48,'S'); setcolor(10); textheight('Setec Software'); textwidth('Setec Software'); SetTextStyle(defaultfont, HorizDir, 1); textwidth('Setec SoftWare'); OutTextXY(15, 83 ,'Setec SoftWare'); OutTextXY(15, 99 ,'WWW.Setec.Com'); { } setcolor(blue); outtextXY(15,200,'1).Software'); outtextXY(15,220,'2).HardWare'); outtextxy(15,240,'3).Tech help'); outtextxy(15,260,'4).Exit'); setcolor(15); { } outtextxy(250,10,'Welcome to '); setcolor(green); SetTextStyle(defaultfont, HorizDir, 2); outtextxy(200,19,'Setec Online.'); SetTextStyle(defaultfont, HorizDir, 1); setcolor(15); outtextxy(160,100,' Setec Online is dedicated to providing the best'); outtextxy(160,120,'customer service available. We also are determined'); outtextxy(160,140,'to provide a wide selection of software and hardware.'); outtextxy(160,160,'We also provide services such as installing hardware'); outtextxy(160,180,'and software with a 10% discount if the product is'); outtextxy(160,200,'purchased from us. Please feel free to browse this'); outtextxy(160,220,'site and send us any comments to:'); setcolor(blue); outtextxy(160,240,'WebMaster@Setec.Com,'); setcolor(15); outtextxy(160,260,'Thank you.'); setcolor(red); outtextxy(180,350,'Please choose a location.'); repeat K:=ReadKey until (K>'0') and (K<'5'); ClearFrame; case K of '1':SoftWare; '2':HardWare; '3':TechHelp; '4':exit; End; end; procedure HardWare; begin; SetTextStyle(defaultfont, HorizDir, 2); outtextxy(190,5,'HardWare'); SetTextStyle(defaultfont, HorizDir, 1); outtextxy(170,30,' One of our goals at Setec is to offer our customers'); outtextxy(170,60,'the best hardware for the best price. We recently added'); outtextxy(170,90,'a variety of chips including the Pentium III 500 MHZ.'); rectangle(190,150,300,250); outtextxy(195,170,'A)Memory'); outtextxy(195,190,'B)Hard Drives'); outtextxy(195,210,'C)Processors'); repeat K:=ReadKey until (K>='A') and (K<'E') or (K>'0') and (K<'7'); setcolor(0); setfillstyle(0,0); bar(151,0,GetmaxX,GetmaxY); setcolor(15); case K of '1':SoftWare; '2':HardWare; '3':TechHelp; '4':exit; 'A':ShowInventory('memory'); 'B':ShowInventory('hard drives'); 'C':ShowInventory('processors'); end; end;{HardWare} procedure SoftWare; begin; SetTextStyle(defaultfont, HorizDir, 2); outtextxy(190,5,'SoftWare'); SetTextStyle(defaultfont, HorizDir, 1); outtextxy(170,30,' At Setec we offer a wide selection of software'); outtextxy(170,60,'All our products are made by us and guaranteed BUG FREE!'); outtextxy(170,90,'Please choose a software topic.'); rectangle(190,150,300,250); outtextxy(195,170,'A)Games'); outtextxy(195,190,'B)Utilities'); outtextxy(195,210,'C)Learning'); repeat K:=ReadKey until (K>='A') and (K<'D') or (K>'0') and (K<'5'); setcolor(0); setfillstyle(0,0); bar(151,0,GetmaxX,GetmaxY); setcolor(15); case K of '1':SoftWare; '2':HardWare; '3':TechHelp; '4':exit; 'A':ShowInventory('games'); 'B':ShowInventory('utilities'); 'C':showinventory('learning'); end; end;{Software} Procedure TechHelp; begin SetTextStyle(defaultfont, HorizDir, 2); outtextxy(180,1,'Tech Help'); SetTextStyle(defaultfont, HorizDir, 1); outtextxy(175,40,'Setec provides technical for most hardware problems'); outtextxy(175,60,'and software problems. For problems caused by our'); outtextxy(175,80,'programs (made by Setec), we will fix it for FREE^.'); outtextxy(175,100,'Frequent customers will get a 20% discount and '); outtextxy(175,120,'installation of a product purchased by us is intitled'); outtextxy(175,140,'to a 10% discount on our already low prices.'); outtextxy(175,160,'Here is a list of our prices in general:'); outtextxy(185,200,'Installation: Hardware-$20 per hour'); outtextxy(185,220,' Software-$10 per hour'); outtextxy(185,240,'Repairing: $25 per hour'); outtextxy(185,260,'Diagnostic: $20'); outtextxy(160,getmaxy-20,'^a diagnostic test will first be performed to'); outtextxy(160,getmaxy-10,'determine actual cause of problem.'); outtextxy(185,300,'To recieve technical help please contact us 1 of 3 ways'); outtextxy(185,320,'E-Mail us at:'); outtextxy(185,340,'Call us at our toll free #: 1-800-21SETEC'); setcolor(blue); outtextxy(300,320,'TechHelp@Setec.com'); setcolor(15); repeat K:=ReadKey until (K>'0') and (K<'5'); setcolor(0); setfillstyle(0,0); bar(151,0,GetmaxX,GetmaxY); setcolor(15); case K of '1':SoftWare; '2':HardWare; '3':TechHelp; '4':exit; End; end; begin {Main} main; end.